package com.canaan.business.common.enums.inOutStock;

/**
 * 入库类型枚举
 */
public enum InOutStockTypeEnum {
//1生产入库 2退料入库 3报废入库 4退货入库 5待检入库 6收货入库 7调拨入库 8其他入库
    GENERAL(0, "通用"),
    PRODUCTION(1, "生产入库"),
    STORES_RETURNED(2, "退料入库"),
    SCRAP(3, "报废入库"),
    SALES_REFUND(4, "退货入库"),
    WAIT_INSPECTION(5, "待检入库"),
    RECEIVING(6, "收货入库"),
    ALLOCATE(7, "调拨入库"),
    OTHER_IN(8, "其他入库"),
    SALES_OUT(9, "销售出库"),
    PICK_OUT(10, "领料出库"),
    SCRAP_OUT(11, "报废出库"),
    ADJUST_OUT(12, "调拔出库"),
    OTHER_OUT(13, "其他出库"),
    MOVE(14, "移库操作"),
    INIT(15, "库存初始化"),
    WAIT_INSPECTION_OUT(16, "待检出库"),
    REPLACE(17, "拆箱"),
    MERGE(18, "合箱"),
    RETURN_OUT(19, "退货出库"),
    MP_OUT(20, "备料出库"),
    MP_IN(21, "备料入库"),
    ;

    private final Integer code;
    private final String message;

    InOutStockTypeEnum(Integer code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        if(code == null){
            return null;
        }
        String message = null;
        for (InOutStockTypeEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
